package com.example.tianling.controller;
import com.example.tianling.common.annotation.Login;
import com.example.tianling.common.utils.R;
import com.example.tianling.common.vo.productVo;
import com.example.tianling.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller
public class ShopController {
@Autowired
    ShopService shopService;
    @Login
    @PostMapping("/shop")
    @ResponseBody
    public R loadShop(){
       //加载商品的，按分类来分，然后是价格
        Map<String, List<productVo>> result =  shopService.getProducts();
        return R.success(result);
    }


}
